<template>
  <!-- 告警记录 -->
  <div class="alarmRecord box-shadow">
    <el-tabs v-model="alarmType">
      <el-tab-pane :label="$t('巡检对象告警')" name="0">
        <inspection></inspection>
      </el-tab-pane>
      <el-tab-pane :label="$t('环境告警')" name="1">
        <environmentalWarning></environmentalWarning>
      </el-tab-pane>
      <el-tab-pane :label="$t('综合告警')" name="2">
        <synthAlarm :isShowSearch="true" :height="800"></synthAlarm>
      </el-tab-pane>
      <el-tab-pane :label="$t('系统告警')" name="3">
        <systemAlarm></systemAlarm>
      </el-tab-pane>
    </el-tabs>
  </div>
</template>
<script>
/**
 * 数据中心-告警记录
 */
import inspection from "./components/inspectionObject.vue";
import environmentalWarning from "./components/environmentalWarning.vue";
import systemAlarm from "./components/systemRecord.vue";
import synthAlarm from "../../robot/monitor/components/synthAlarm.vue";

export default {
  components: {
    environmentalWarning,
    systemAlarm,
    inspection,
    synthAlarm,
  },
  data() {
    return {
      // tabs切换type
      alarmType: "0",
      isQuery: "",
    };
  },
  watch: {
    isQuery(val) {
      if (val == undefined) {
        this.alarmType = "0";
      } else {
        this.alarmType = val;
      }
    },
    // 监听tabs切换
    alarmType(val) {
      this.alarmType = val;
    },
  },
  created() {
    this.isQuery = this.$route.query.info;
  },
  methods: {},
};
</script>
<style lang="scss" scoped></style>
